package cn.com.scitc.licenseplateback.model;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "cityCode", schema = "CubeLibrary", catalog = "")
public class CityCodeEntity {
    private int id;
    private Integer citycode;
    private String city;
    private String initial;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "citycode", nullable = true)
    public Integer getCitycode() {
        return citycode;
    }

    public void setCitycode(Integer citycode) {
        this.citycode = citycode;
    }

    @Basic
    @Column(name = "city", nullable = true, length = 100)
    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    @Basic
    @Column(name = "initial", nullable = true, length = 1)
    public String getInitial() {
        return initial;
    }

    public void setInitial(String initial) {
        this.initial = initial;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CityCodeEntity that = (CityCodeEntity) o;
        return id == that.id &&
                Objects.equals(citycode, that.citycode) &&
                Objects.equals(city, that.city) &&
                Objects.equals(initial, that.initial);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, citycode, city, initial);
    }
}
